<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>新增人员</title>
		<link rel="stylesheet" type="text/css" media="all" href="js/demo/calendar-win2k-cold-1.css" title="win2k-cold-1" />
  <script type="text/javascript" src="js/demo/jss/calendar.js"></script>
  <script type="text/javascript" src="js/demo/jss/calendar-zh.js"></script>
  <script type="text/javascript" src="js/demo/jss/calendar-setup.js"></script>
	</head>
	<script type="text/javascript">
	var flag1=false;
	var flag2=false;
	var flag3=false;
	
	
    function getid(id,name,res){
   // alert('aaaaaaaaa');
      //alert(id);
      var te=document.getElementById(id);
      if(te.value==""||te.value==null){
       flag1=false;
       document.getElementById(name).innerHTML = res+"不能为空";
      }else{
      flag1=true;
       document.getElementById(name).innerHTML = "";
      }
     // alert(te.value+"");
     }
     
     function que(){
     var mi=document.getElementById('pass').value;
     var que=document.getElementById('comfire').value;
     if(que==""||que==null){
      flag2=false;
      document.getElementById('queren').innerHTML = "确认密码不能为空";
     }
     else{
       document.getElementById('queren').innerHTML = ""; 
     if(mi!=que){
     document.getElementById('queren').innerHTML = "确认密码与原密码不相同";
     }
     else{
     flag2=true;
     document.getElementById('queren').innerHTML = ""; 
     }
     }
     }
     
     function youxiang(){
     var temp = document.getElementById("mail");
     var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
     if(temp.value!=""){
        
     if(!myreg.test(temp.value)){
        document.getElementById('1mail').innerHTML = "邮箱格式不正确";
      }
      else{
       flag3=true;
      document.getElementById('1mail').innerHTML = ""; 
      }
      }
      else{
         flag3=false;
        document.getElementById('1mail').innerHTML = "邮箱不能为空";
      }
     
     }
     
     function check(){
     if(flag1==true&&flag2==true&&flag3==true) return true;
     else {
     alert("请填写表单所有信息");
     return false;
     }
     }
	</script>
	<body><center>
	<script src="js/Settime.js" type="text/javascript"></script> 
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" valign="top" background="images/mail_leftbg.gif">
					<img src="images/left-top-right.gif" width="17" height="29" />
				</td>
				<td valign="top" background="images/content-bg.gif">
					<table width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31">
								<div class="titlebt">
									人员信息
								</div>
							</td>
						</tr>
					</table>
				</td>
				<td width="16" valign="top" background="images/mail_rightbg.gif">
					<img src="images/nav-right-bg.gif" width="16" height="29" />
				</td>
			</tr>
	</table>
			<div class="btwz">
			<br />
			<br /><br /><br />
							
						</div>
						<br />
						<s:form  method="post" action="chenhao/addemp" onsubmit="return check()">
							<table width="50%" cellspacing="1" cellpadding="3" border="0" bgcolor="#6298e1">
								<tr>
								    <td width="40" nowrap="" height="25"  align="center">
										<div id="some"></div>
									</td>
									<td width="40" nowrap="" height="25"  align="center">
									      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新增人员信息
									</td>
								
									
								</tr>
							<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp;姓名 ：
									</td>
									<td nowrap="" height="30" align="center" valign="middle">
									 <input type="text" id="name" name="emp.uname" onblur="getid('name','1name','姓名')" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 0px 0px 130px;" />
									<font color="red" id="1name"></font>
									</td>
									
								</tr>
									<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp;密码 ：
									</td>
									<td nowrap="" height="30" align="center" valign="middle">
									 <input type="password" id="pass" name="emp.upass" onblur="getid('pass','1pass','密码')" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 0px 0px 130px;" />
									<font color="red" id="1pass"></font>
									</td>
									
								</tr>
								</tr>
									<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp;确认密码 ：
									</td>
									<td nowrap="" height="30" align="center" valign="middle">
									 <input type="password" name="queren" id="comfire" onblur="que()" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 0px 0px 130px;" />
									<font color="red" id="queren"></font>
									</td>
									
								</tr>
							    	<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp;所属类型 ：
									</td>
									<td nowrap="" height="30" align="center" valign="middle">
									 <select name="emp.utype" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 0px 0px 130px;" >
									        <option value="1" >普通管理员</option>
									        <option value="2" >普通员工</option>
				     	             </select>
									</td>
									
								<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp; 电话：
									</td>
									<td nowrap="" height="30" align="center">
									 <input type="text" name="emp.mobile" id="mobile" onblur="getid('mobile','1mobile','电话号码')" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 10px 0px 130px;" "/>
									<font color="red" id="1mobile"></font>
									</td>
									
								</tr>
                                <tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp; 邮箱：
									</td>
									<td nowrap="" height="30" align="center">
									 <input type="text" name="emp.mail" id="mail" onblur="youxiang()"  style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 10px 0px 130px;" "/>
									<font color="red" id="1mail"></font>
									</td>
									
								</tr>
								</tr>
								<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp;所属部门：
									</td>
							
									<td nowrap="" height="30" align="center" >
									  <select name="udept" style="border:0;background:transparent; font-size:18px;width:80px;height:20px;" >
									  
										  <s:iterator value="list" var="li">
									        <option value="${li.deptid }" >${li.deptname}</option>
				     	                 </s:iterator>
					                    </select>
										
									</td>
					            
								</tr>
                                 <tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp; 手机：
									</td>
									<td nowrap="" height="30" align="center">
									 <input type="text" name="emp.telephone" id="phone" onblur="getid('phone','1phone','手机号码')" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 10px 0px 130px;" "/>
									<font color="red" id="1phone"></font>
									</td>
									
								</tr>

								<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp; 性别：
									</td>
									<td nowrap="" height="30" align="center">
									  <select name="emp.sex" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 0px 0px 130px;" >
									        <option value="0" >男</option>
									        <option value="1" >女</option>
				     	             </select>
									</td>
									
								</tr>
								<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp; 出生年月：
									</td>
									<td nowrap="" height="30" align="center">
									 <input readonly name="emp.birthday"  id="begin_date_b" onblur="getid('begin_date_b','1bir','出生年月')"style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 10px 0px 130px;" "/>
									<font color="red" id="1bir"></font>
									<input type="button" value="选择时间" onclick="return showCalendar('begin_date_b', 'y-m-d');">
									</td>
									
								</tr>
								<tr bgcolor="#ebf2f9" onmouseout="this.style.backgroundColor = ''" style="" onmouseover="this.style.backgroundColor = '#FFFFFF'">
									<td nowrap="" height="30" align="center">
										&nbsp;&nbsp;&nbsp;&nbsp;备注：
									</td>
									<td nowrap="" height="30" align="center">
									 <input type="text" name="emp.usernote" id="note" onblur="getid('note','1note','备注')" style="border:0;background:transparent; font-size:18px;height:1em;padding: 0px 10px 0px 130px;" "/>
									<font color="red" id="1note"></font>
									</td>
									
								</tr>
							</table>
							<p align="center">
								<input type="submit" class="button" value="增加人员 &raquo;" />
								&nbsp;
							</p>
						</s:form>
						<br />
						<br />
			            <br />
			            <br />
			<div style="margin-left:180px">
		<table width="99%" align="center">
			<tr>
				<td class="left_txt">
								<img src="images/icon-mail2.gif" width="16" height="11">
								&nbsp;&nbsp;&nbsp;&nbsp;邮箱：liuyongwade@gmail.com
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								组员：刘勇&nbsp;&nbsp;程署&nbsp;&nbsp;陈皓&nbsp;&nbsp;席晓明&nbsp;&nbsp;刘广云
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;版权所有 侵权必究
							</td>
						</tr>
						</table>
						</div>
					</center>
	</body>
</html>
	